package com.htg.dialog;

import android.app.AlertDialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;



public class DialogHint {

    private Context cxt;



    public DialogHint(Context cxt) {
        this.cxt = cxt;
    }

    public void show(String content) {
        AlertDialog.Builder builder = new AlertDialog.Builder(cxt);
        AlertDialog alertDialog = builder.create();



        View view = LayoutInflater.from(cxt).inflate(R.layout.dialog_hint, null);

        TextView tvContent = view.findViewById(R.id.tv_dialog_hint_content);
        tvContent.setText(content);
        Button btOk = view.findViewById(R.id.bt_dialog_hint_ok);
        btOk.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                alertDialog.dismiss();
            }
        });


        alertDialog.setView(view);
        alertDialog.show();


        /*int width = cxt.getResources().getDimensionPixelSize(R.dimen.dp_90);
        WindowManager.LayoutParams layoutParams = alertDialog.getWindow().getAttributes();
        layoutParams.width = width;
        alertDialog.getWindow().setAttributes(layoutParams);*/

    }





}
